package com.ebidding.Utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

public class DateUtil {

    public static String DataFormtStr(Date date, String f) {
        if(date == null){
            return "";
        }
        SimpleDateFormat sdf = new SimpleDateFormat(f);

        return  sdf.format(date);
    }

    public static void main(String[] args) {
        Date a  = new Date();
        DateUtil dateUtil = new DateUtil();
        System.out.println(DateUtil.DataFormtStr(a,"yyyy-MM-dd HH:mm:ss"));
    }
}
